#ifndef AUTHORITYDIALOG_H
#define AUTHORITYDIALOG_H

#include <QWidget>
#include <QDialog>
#include <QDebug>

namespace Ui {
class AuthorityDialog;
}

enum AuthorityType {
    AuthorityType_Null = 0,
    AuthorityType_HomeUi_Export,
    AuthorityType_SystemSettingUi_ResetFactory,
    AuthorityType_SystemSettingUi_Logoin,
    AuthorityType_SystemSettingUi_UpdateSoftware,
    AuthorityType_PatientInfoUi_Export,
    AuthorityType_PatientInfoUi_Delete,
    AuthorityType_PatientInfoUi_Modify,
    AuthorityType_ImageSettingUi_Save,
    AuthorityType_ImageSettingUi_Recover
};

class AuthorityDialog : public QDialog
{
    Q_OBJECT

public:
    static AuthorityDialog* getInstance();
    void setAuthorityType(AuthorityType type);

    ~AuthorityDialog();

protected:
    void showEvent(QShowEvent *)override;
    void changeEvent(QEvent *e);
private slots:
    void on_no_clicked();

    void on_yes_clicked();

signals:
    void HomeUi_Export_Signal();
    void SystemSettingUi_ResetFactory_Signal();
    void SystemSettingUi_UpdateSoftware_Signal();
    void SystemSettingUi_Logoin_Signal();
    void PatientInfoUi_Export_Signal();
    void PatientInfoUi_Delete_Signal();
    void PatientInfoUi_Modify_Signal();
    void ImageSettingUi_Save_Signal();
    void ImageSettingUi_Recover_Signal();

private:
    explicit AuthorityDialog(QWidget *parent = 0);

private:
    AuthorityType g_type;
    Ui::AuthorityDialog *ui;
};

#endif // AUTHORITYDIALOG_H
